let express = require('express');
let request = require('request');
let colors = require('colors');
let url = require("url");
let address = require('address');
 
let app = express();

app.use((req, res, next) => {
	let path = url.parse(req.url).pathname;
	console.log('request resource at: ' + path.green);
	next();
});

app.use('/', express.static('dist'));

let server = app.listen(8081, () => {
	let host = address.ip();
	let port = server.address().port;
	console.log('server runing at http://%s:%s'.yellow, host, port);
	require('child_process').exec('start http://' + host + ':' + port + '/html/index.html');
});